<?php
include './HttpClient.php';
class Demo
{
    /**
     * 测试环境：http://openapi-test.scimall.org.cn
     * 生产环境：https://openapi.scimall.org.cn
     */
    public static $url = "http://openapi-test.scimall.org.cn";
    /**
     * appId 科界提供
     */
    public static $appId = "cc082bd5-86b1-4b54-b67a-45bd51e49616";
    /**
     * 密钥 科界提供
     */
    public static $secretKey = "022ae64637c032e064cd252f990e60ae";

    /**
     * @desc   获取用户信息
     *
     * @param $token
     * @param $sign
     *
     * @return array
     * @author yzf
     * @date   2021/8/18 7:59 下午
     */
    public function getUserInfo($token, $sign)
    {
        $postData = [
            'sso_token' => $token,
            'sso_sign' => $sign
        ];
        //创建签名
        $return = HttpClient::createSn('/sso/getuserinfo', $postData, self::$secretKey, self::$appId);
        //拼接请求地址
        $url = self::$url . '/sso/getuserinfo/' . '?timestamp=' . $return['timestamp'] . '&appid=' . $return['appid'] . '&sn=' . $return['sn'];
        //发送数据，获取返回用户信息
        $output = HttpClient::httpRequest($url, $postData);
        return $output;
    }
}
//sso 获取的 sign
$sign  = '611d354800e5e6e3f20f44617092922e';
//sso 获取的 token
$token = '69282f19-49d1-4a6f-b75d-a9eb6027064f';
$userInfo =(new Demo())->getUserInfo($token,$sign);

print_r($userInfo);